package lanou.autohome.recommend.fragments;

import android.widget.ListView;

import lanou.autohome.URLValues;
import lanou.autohome.basetool.BaseFragment;
import lanou.autohome.R;
import lanou.autohome.basetool.NetTool;
import lanou.autohome.recommend.adapters.QuotationAdapter;
import lanou.autohome.recommend.beans.QuotationBean;

/**
 * Created by dllo on 16/8/15.
 * 推荐 -> 行情
 */
public class QuotationFragment extends BaseFragment {


    private ListView listView;

    @Override
    protected int setLayout() {
        return R.layout.fragment_recommend_quotation;
    }

    @Override
    protected void initView() {

        listView = bindVie(R.id.listview_recommend_quotation);

    }

    @Override
    protected void intiData() {

        final QuotationAdapter quotationAdapter = new QuotationAdapter(getContext());
        mNetTool.getNetData(URLValues.MARKET_URL, QuotationBean.class, new NetTool.NetListener<QuotationBean>() {
            @Override
            public void onSuccess(QuotationBean quotationBean) {
                quotationAdapter.setQuotationBean(quotationBean);
                listView.setAdapter(quotationAdapter);
            }

            @Override
            public void onError(String errorMsg) {

            }
        });

    }
}
